const px2vw=require('postcss-px-to-viewport')
// vue.config.js
module.exports = {
  // 配置代理
  devServer: {
    proxy: {
      //请求路径当中包含 /api
      '/api': {
        //代理的目标地址
        target: 'http://localhost:3000/',
        changeOrigin: true,
        //路径的重写
        pathRewrite: {
          '^/api': '' // rewrite path
        }
      },
      '/ajax': {
        //代理的目标地址
        target: 'https://m.ly.com/?refid=18024458',
        changeOrigin: true,
      }
    }
  },
    css: {
      loaderOptions: {
       postcss:{
           plugins:[px2vw({
            unitToConvert: 'px',
            viewportWidth: 375,
            unitPrecision: 5,
            propList: ['*'],
            viewportUnit: 'vw',
            fontViewportUnit: 'vw',
            selectorBlackList: [],
            minPixelValue: 1,
            mediaQuery: false,
            replace: true,
            exclude: [/node_modules/],
            include: undefined,
            landscape: false,
            landscapeUnit: 'vw',
            landscapeWidth: 568
           })]
       }
      }
    }
}